package com.zhuanzhuan.hero.user.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName RiskControlFieldEnum
 * @Description 风控异步结果通知的字段枚举
 * @Author hanjunjun
 * @Date 2024/6/22 14:47
 */
@Getter
public enum RiskControlFieldEnum {

    //----------------个人基本信息------------------
    NICKNAME ("nickname", "昵称"),
    COMPANY_POSITION ("position", "职位"),
    PROFILE_PHOTO ("profilePicture", "头像"),

    //----------------个人联系方式------------------
    CONTACT_MOBILE("mobile", "联系手机号"),
    WECHAT_NO("wechatNo", "微信号"),
    DOUYIN_NICKNAME("douyinNickname", "抖音昵称"),
    STORE_NAME("shopName", "店铺名称"),
    STORE_ADDRESS("shopAddress", "店铺地址"),
    WECHAT_GROUP_NAME("wechatGroupName", "微信群名称"),
    WECHAT_GROUP_INTRODUCTION("wechatGroupIntroduction", "微信群简介"),
    WECHAT_GROUP_CODE("wechatGroupPicture", "微信群二维码"),
    STORE_PHOTOS("shopPictures", "店铺实拍"),

    //----------------个人简介------------------
    PERSON_INTRODUCTION("content", "个人简介"),

    //---------------同行认证标签--------------
    FRATERNITY_AUTH_LABEL_NAME("labelName", "同行认证标签名称"),

    //---------------背景图--------------
    USER_BACKDROP("cover", "主页背景"),

    //---------------回收商端外信息-------------
    OUTER_NICKNAME("recycleName", "回收商昵称"),
    OUTER_PROFILE_PHOTO("recycleProfilePicture", "回收商头像"),

    //---------------不靠谱认证-------------
    UNRELIABLE_REASON("reason", "理由"),
    UNRELIABLE_PICS("pictures", "图片"),



    ;

    private final String field;

    private final String title;

    RiskControlFieldEnum(String field, String title) {
        this.field = field;
        this.title = title;
    }

    private static final Map<String, String> FIELD_TITLE_MAP = new HashMap<>();

    static {
        for (RiskControlFieldEnum anEnum : RiskControlFieldEnum.values()) {
            FIELD_TITLE_MAP.put(anEnum.getField(), anEnum.title);
        }
    }

    public static String getTitleByField(String field) {
        if (StringUtils.isBlank(field)) {
            return "";
        }
        return FIELD_TITLE_MAP.get(field);
    }
}
